package com.czl.base.data.source.tengyun

import com.czl.base.base.BaseBean
import com.czl.base.data.api.TengYunApiService
import com.czl.base.data.bean.tengyun.*
import io.reactivex.Observable
import okhttp3.MediaType
import okhttp3.RequestBody

/**
 * @author by xubin,
 * @date on 2022/1/17.
 * PS: Not easy to write code, please indicate.
 */
class TengYunHttpData(private val apiService: TengYunApiService) {

    fun selectCompanyByModule(paramsJson: String): Observable<BaseBean<ListBean<CompanyBean>>> {
        return apiService.selectCompanyByModule(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun selectOrganization(paramsJson: String): Observable<BaseBean<ListBean<OrgBean>>> {
        return apiService.selectOrganization(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getUserListByOrgIds(paramsJson: String): Observable<BaseBean<MutableList<UserBean>>> {
        return apiService.getUserListByOrgIds(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun addProfitFacility(paramsJson: String): Observable<BaseBean<FacilityBean>> {
        return apiService.addProfitFacility(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun summaryInventoryFacility(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.summaryInventoryFacility(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun addInventoryNote(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.addInventoryNote(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getFacilityByNo(paramsJson: String): Observable<BaseBean<FacilityBean>> {
        return apiService.getFacilityByNo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun wechatSelectFacilityInfo(paramsJson: String): Observable<BaseBean<InventoryAssetBean>> {
        return apiService.wechatSelectFacilityInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun deleteInventoryProfidByInventoryId(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.deleteInventoryProfidByInventoryId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun summaryTask(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.summaryTask(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getIdByNeighNo(paramsJson: String): Observable<BaseBean<Int>> {
        return apiService.getIdByNeighNo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getStorehouseByUserId(paramsJson: String): Observable<BaseBean<StorehouseBean>> {
        return apiService.getStorehouseByUserId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getOrgUseManageStorehouse(paramsJson: String): Observable<BaseBean<StorehouseBean>> {
        return apiService.getOrgUseManageStorehouse(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getSortAllList(paramsJson: String): Observable<BaseBean<ListBean<SortBean>>> {
        return apiService.getSortAllList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getAPPIndexTotal(paramsJson: String): Observable<BaseBean<StorehouseBean>> {
        return apiService.getAPPIndexTotal(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getSortList(paramsJson: String): Observable<BaseBean<ListBean<SortBean>>> {
        return apiService.getSortList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun addSortInfo(paramsJson: String): Observable<BaseBean<SortBean>> {
        return apiService.addSortInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getClassStockList(paramsJson: String): Observable<BaseBean<ListBean<CategoryBean>>> {
        return apiService.getClassStockList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun WXgetMyPurchaseApplicationList(paramsJson: String): Observable<BaseBean<ListBean<PurchaseBean>>> {
        return apiService.WXgetMyPurchaseApplicationList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getPurchaseApplicationList(paramsJson: String): Observable<BaseBean<ListBean<PurchaseBean>>> {
        return apiService.getPurchaseApplicationList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun addApplication(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.addApplication(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getCardListInUseApplication(paramsJson: String): Observable<BaseBean<ListBean<PurchaseOrderBean>>> {
        return apiService.getCardListInUseApplication(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getPurchaseStorageSortList(paramsJson: String): Observable<BaseBean<ListBean<SortBean>>> {
        return apiService.getPurchaseStorageSortList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun WXGetMyApplicationList(paramsJson: String): Observable<BaseBean<ListBean<UsageBean>>> {
        return apiService.WXGetMyApplicationList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun WXGetApplicationInfo(paramsJson: String): Observable<BaseBean<UsageBean>> {
        return apiService.WXGetApplicationInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun isCanCancel(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.isCanCancel(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun wxApprpveApplication(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.wxApprpveApplication(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun wxApprpveApplicationHandle(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.wxApprpveApplicationHandle(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun approveMoveApplication(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.approveMoveApplication(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun checkApplication(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.checkApplication(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun nextTaskProcess(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.nextTaskProcess(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun hangUpTaskProcess(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.hangUpTaskProcess(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun addUseApplication(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.addUseApplication(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun addApplyInfo(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.addApplyInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getRoleProcessList(paramsJson: String): Observable<BaseBean<List<Any?>>> {
        return apiService.getRoleProcessList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun isFacilityManagerByUserIdAndCompanyId(paramsJson: String): Observable<BaseBean<Any?>> {
        return apiService.isFacilityManagerByUserIdAndCompanyId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getManageCompanystorehouseList(paramsJson: String): Observable<BaseBean<ListBean<StoreHouseListBean>>> {
        return apiService.getManageCompanystorehouseList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun addAssetApplication(paramsJson: String): Observable<BaseBean<AssetHandleBean>> {
        return apiService.addAssetApplication(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun selectApplication(paramsJson: String): Observable<BaseBean<PurchaseBean>> {
        return apiService.selectApplication(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun selectHandleApplicationByHandleApplicationId(paramsJson: String): Observable<BaseBean<AssetHandleBean>> {
        return apiService.selectHandleApplicationByHandleApplicationId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getUserApprovalList(paramsJson: String): Observable<BaseBean<ListBean<UsageBean>>> {
        return apiService.getUserApprovalList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun wechatGetMyMoveApplicationList(paramsJson: String): Observable<BaseBean<ListBean<StoreMoveBean>>> {
        return apiService.wechatGetMyMoveApplicationList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getMoveInfo(paramsJson: String): Observable<BaseBean<StoreMoveBean>> {
        return apiService.getMoveInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getMoveApplicationList(paramsJson: String): Observable<BaseBean<ListBean<StoreMoveBean>>> {
        return apiService.getMoveApplicationList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getStorehouseStockInfo(paramsJson: String): Observable<BaseBean<ListBean<SortBean>>> {
        return apiService.getStorehouseStockInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun selectFacilityListInUseByCompanyIdAndUserId(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleFacilityBean>>> {
        return apiService.selectFacilityListInUseByCompanyIdAndUserId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun selectFacilityListInStroerHouseByCompanyIdAndUserId(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleFacilityBean>>> {
        return apiService.selectFacilityListInStroerHouseByCompanyIdAndUserId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessDamageProList(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleFacilityBean>>> {
        return apiService.getProcessDamageProList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun selectFacilityListInInventoryLoss(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleFacilityBean>>> {
        return apiService.selectFacilityListInInventoryLoss(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun selectMyHandleApplicationList(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleBean>>> {
        return apiService.selectMyHandleApplicationList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessListBySearch(paramsJson: String): Observable<BaseBean<ListBean<ApproveBean>>> {
        return apiService.getProcessListBySearch(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }


    fun getTaskListBySearch(paramsJson: String): Observable<BaseBean<ListBean<ApproveBean>>> {
        return apiService.getTaskListBySearch(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessSortUseInfo(paramsJson: String): Observable<BaseBean<MutableList<AssetHandleSortBean>>> {
        return apiService.getProcessSortUseInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessProUseInfo(paramsJson: String): Observable<BaseBean<MutableList<AssetHandleSortBean>>> {
        return apiService.getProcessProUseInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessSortStockInfo(paramsJson: String): Observable<BaseBean<MutableList<AssetHandleSortBean>>> {
        return apiService.getProcessSortStockInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessProStockInfo(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleSortBean>>> {
        return apiService.getProcessProStockInfo(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessDamageSortList(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleSortBean>>> {
        return apiService.getProcessDamageSortList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessDamageProListStore(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleSortBean>>> {
        return apiService.getProcessDamageProListStore(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessInventorySortList(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleSortBean>>> {
        return apiService.getProcessInventorySortList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getProcessInventoryProList(paramsJson: String): Observable<BaseBean<ListBean<AssetHandleSortBean>>> {
        return apiService.getProcessInventoryProList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getTaskUserByRelationId(paramsJson: String): Observable<BaseBean<List<TaskUserBean>>> {
        return apiService.getTaskUserByRelationId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun searchUsers(paramsJson: String): Observable<BaseBean<TaskUserBean>> {
        return apiService.searchUsers(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun wechatGetMyTaskList(paramsJson: String): Observable<BaseBean<ListBean<InventoryAssetBean>>> {
        return apiService.wechatGetMyTaskList(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun wechatGetTaskFacilityInfoCountByTaskId(paramsJson: String): Observable<BaseBean<InventoryAssetCountBean>> {
        return apiService.wechatGetTaskFacilityInfoCountByTaskId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun wechatGetTaskFacilityInfoByTaskId(paramsJson: String): Observable<BaseBean<ListBean<InventoryAssetBean>>> {
        return apiService.wechatGetTaskFacilityInfoByTaskId(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getclassificationlistCompany(paramsJson: String): Observable<BaseBean<List<CategoryBean>>> {
        return apiService.getclassificationlistCompany(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }

    fun getFacilityNoByRule(paramsJson: String): Observable<BaseBean<String?>> {
        return apiService.getFacilityNoByRule(
            RequestBody.create(
                MediaType.parse("application/json; charset=utf-8"),
                paramsJson
            )
        )
    }
}